<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>NextTick</title>
    <script src="vue.js"></script>
</head>
<body>
    <div id="app">
        <example></example>
    </div>
    <script>
        Vue.component('example',{
            template:'<span @click="updateMessage">{{message}}</span>',
            data() {
                return {
                    message:'未更新'
                }
            },
            methods: {
                updateMessage(){
                    this.message = '已更新'
                    console.log(this.$el.textContent)
                    this.$nextTick(function(){
                        console.log(this.$el.textContent)
                    })
                }
            },
        })
        const vm = new Vue({
            el:'#app'
        })
        
    </script>
    // 
</body>
</html>



